using System;
using System.Collections.Generic;
using System.Text;

namespace IGlobalist.Cms.Model
{
    [Serializable]
    public class Content :  CmsObject, IContent
    {
        #region IXml Members

        public bool FromXml(string xml)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        public string ToXmlString()
        {
            throw new Exception("The method or operation is not implemented.");
        }

        #endregion

        #region IContent Members
        private ContentNoteList _NoteList = new ContentNoteList();
        public ContentNoteList NoteList
        {
            get
            {
                return _NoteList;
            }
            set
            {
                _NoteList = value;
            }
        }

        public DateTime PublishedDate
        {
             get
            {
                return Convert.ToDateTime(GetExtPropertyValue("PublishedDate"));
            }
            set
            {
                SetExtPropertyValue("PublishedDate", value);

            }
        
        }

        public string Source
        {
             get
            {
                return (string)GetExtPropertyValue("Source");
            }
            set
            {
                SetExtPropertyValue("Source", value);

            }
        }
        public bool IsHot
        {
            get
            {
                return Convert.ToBoolean(GetExtPropertyValue("IsHot"));
            }
            set
            {
                SetExtPropertyValue("IsHot", value);

            }
        }

        public int NumberOfRead
        {
            get
            {
                return Convert.ToInt32( GetExtPropertyValue("NumberOfRead"));
            }
            set
            {
                SetExtPropertyValue("NumberOfRead", value);

            }
        }

        public bool CommentEnabled
        {
            get
            {
                return Convert.ToBoolean(GetExtPropertyValue("CommentEnabled"));
            }
            set
            {
                SetExtPropertyValue("CommentEnabled", value);

            }
        }

        public string AuthorNews
        {
            get
            {
                return (string)GetExtPropertyValue("AuthorNews");
            }
            set
            {
                SetExtPropertyValue("AuthorNews", value);

            }
        }

       
        public long PageID
        {
            get
            {
                return Convert.ToInt64(GetExtPropertyValue("PageID"));
            }
            set
            {
                SetExtPropertyValue("PageID", value);

            }
        }

       
        public long CategoryID
        {
            get
            {
                return Convert.ToInt64(GetExtPropertyValue("CategoryID"));
            }
            set
            {
                SetExtPropertyValue("CategoryID", value);

            }
        }

        public string Title
        {
            get
            {
                return (string)GetExtPropertyValue("Title");
            }
            set
            {
                SetExtPropertyValue("Title", value);
            }
        }

        string IContent.Content
        {
            get
            {
                return (string)GetExtPropertyValue("Content");
            }
            set
            {
                SetExtPropertyValue("Content", value);

            }
        }

        public string Summary
        {
            get
            {
                return (string)GetExtPropertyValue("Summary");
            }
            set
            {
                SetExtPropertyValue("Summary", value);

            }
        }

        private string _authorName;
        public string AuthorName
        {
            get
            {
                return _authorName;
            }
            set
            {
                _authorName = value;
            }
        }

        private string _authorInfo;
        public string AuthorInfo
        {
            get
            {
                return _authorInfo;
            }
            set
            {
                _authorInfo = value;
            }
        }


        
        #endregion

        #region ICmsObject Members


        public bool FromCmsObject(CmsObject obj)
        {
            return base.FromCmsObject(obj);
        }

        #endregion

       

       
    }
}
